#include "Avalon/ServiceLocator/AuthenticatedServerChannel.hpp"

using namespace Avalon;
using namespace Avalon::ServiceLocator;

AuthenticatedServerChannel::AuthenticatedServerChannel() {}

AuthenticatedServerChannel::~AuthenticatedServerChannel() {}

bool AuthenticatedServerChannel::IsLoggedIn() const {
  return m_account.m_id != -1;
}

const DirectoryEntry::Tag& AuthenticatedServerChannel::GetAccount() const {
  return m_account;
}

void AuthenticatedServerChannel::SetAccount(
    const DirectoryEntry::Tag& account) {
  assert(m_account.m_id == -1);
  m_account = account;
}

void AuthenticatedServerChannel::ResetAccount() {
  m_account = DirectoryEntry::Tag();
}
